<template>
	<div class="bg-act-box">
		<el-dialog
		  title="页面配色"
		  :visible.sync="dialogVisible"
		  width="30%"
		  :before-close="handleClose">
		  <div class="b-j-box">
				<span class="m-s-txt-lb">页面配色:</span>
				<el-radio-group v-model="radio" @change="radioChange">
					<el-radio  label="1">默认</el-radio>
					<el-radio  label="2">自定义</el-radio>
				</el-radio-group>
				<div class="block" v-if="radio == '2'">
					<el-color-picker v-model="skin.bgColor" size="small" @change="change"></el-color-picker>
				</div>
		  </div>
		</el-dialog>
	</div>
</template>

<script>
	import addPhoto from "@/components/comm/AddPhoto.vue";
	import uploadPic from "@/js/upload/UploadPic.js";
	import staticConst from "@/js/const/StaticConst.js";
	export default
	{
		data()
		{
			return{
				dialogVisible:false,
				bgColor:"#3388FF",
				radio: '1',
				skin:
				{
					bgColor:"#3388FF",
				},
				act:"",
			}
		},
		
		methods:
		{
			radioChange (e) {
				if (e == 1) {
					this.skin.bgColor = this.bgColor;
				}
			},
			showWin(data)
			{
				this.dialogVisible = true;
				console.log("data====:",data)
				this.act = data.act;
				if(data.data.bgColor != "#3388FF")
					this.radio = "2";
				this.skin = data.data;
			},
			
			handleClose()
			{
				this.dialogVisible = false;
			},
			
			change()
			{
				let obj = {};
				obj.act = this.act;
				obj.data = this.skin;
				this.$emit("editGdDetailBg",obj);
			},
		}
	}
</script>

<style lang="scss" scoped>
	
	.bg-act-box
	{
		::v-deep.el-dialog
		{
			margin-top: 40vh !important;
		}
		
		.b-j-box
		{
			height: 36px;
			display: flex;
			align-items: center;
		}
	}
	.block {
		margin-left: 20px;
	}
	.m-s-txt-lb
	{
		padding-right: 10px;
	}
	.o-u-box
	{
		padding-left: 90px;
		display:flex;
		align-items: center;
		padding-top: 20px;
		.u-btn
		{
			margin-left: 10px;
			padding: 4px 20px;
			background-color: #3388FF;
			color:#FFF;
			border-radius: 4px;
			cursor: pointer;
		}
	}
	
</style>